<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<%@ taglib uri='/tags/bc' prefix='bc' %>
<html>
 	<head>
 		<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/javascript/jquery/jquery.min.js"></script>
 		<link href="<%=request.getContextPath()%>/style/jquery/jkmegamenu.css" rel="stylesheet" type="text/css"/>
   	  	<link href="<%=request.getContextPath()%>/style/global.css" rel="stylesheet" type="text/css"/>
	  	<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/javascript/jquery/jkmegamenu.js">
		</script>

	
	  	<title>TabMenu Demo home</title>
  	</head>
  	<body>
  		<html:form action="/tabmenu" >
  			<h1>JQuery Demo Tabs</h1>
	
			<nested:iterate property="tabMenuInfo">
			
				<nested:define id="anchorId" property="anchorid"/>
				<nested:define id="menuId" property="menuid"/>
				<nested:define id="subject" property="name"/>
				<!-- Set the javascript data -->
				<script type="text/javascript">
				    //jkmegamenu.definemenu("anchorid", "menuid", "mouseover|click")
					jkmegamenu.definemenu("<%=anchorId%>", "<%=menuId%>",   "mouseover");
				</script>  
				<!-- Main tab information -->
				<a href="http://www.javascriptkit.com" id="<%=anchorId%>">
					<nested:write property="name"/>
				</a>&nbsp;&nbsp;			
		
				<div id="<%=menuId%>" class="megamenu">
					<nested:iterate property="topicInfo" indexId="counter">
						<nested:define id="topic" property="name"/>
						<div class="column">
							<h3><nested:write property="name"/></h3>
							<ul>
								<nested:iterate property="links" >
									<nested:define id="linkvalue" property="link"/>
										<%
											String link_string = request.getContextPath() + "/tabmenu.do?action=showmenu&subject=" + subject + "&topic=" + topic;
										%>
										<li><a href="<%=link_string%>"><nested:write property="name"/></a></li>
								</nested:iterate>
							</ul>
						</div>
						<% System.out.println("================> Counter: " + counter); %>
						<logic:equal name="counter" value="3">
							<% System.out.println("================> Break is needed"); %>
							<br style="clear: left" /> <!--Break after 3rd column. Move this if desired-->
						</logic:equal>
					</nested:iterate>
				</div>
			</nested:iterate>
			<br/>
			<bc:bc/>
		</html:form>
  </body>
</html>